﻿using Microsoft.Xna.Framework;
using System;

namespace Library 
{
    public class FirstPersonCamera : Camera
    {
        Vector3 rotation;
        Vector3 translation;

        public FirstPersonCamera(Screen Parent) : base(Parent) { }
        public FirstPersonCamera() : base(){ }

        public void RotateTranslate(Vector3 Rotation, Vector3 Translation)
        {
            translation += Translation;
            rotation += Rotation;
        }

        public override void Update()
        {

            Rotation = MathUtils.Vector3ToMatrix(rotation);
            translation = Vector3.Transform(translation, Rotation);
            Position += translation;
            translation = Vector3.Zero;
            Target = Vector3.Add(Position, Rotation.Forward);
            base.Update();
        }
    }
}